void setup() {
  pinMode(PB0, PWM);
  pinMode(PA7, PWM);
  pinMode(PA6, PWM);
  pinMode(PA3, PWM);
  pinMode(PA2, PWM);
  pinMode(PA1, PWM);
  pinMode(PA0, PWM);
  pinMode(PB7, PWM);
  pinMode(PB6, PWM);
  pinMode(PA10, PWM);
  pinMode(PA9, PWM);
  pinMode(PA8, PWM);
}
void loop() {
  //指数式增加亮度，适合驱动LED，看起来亮度更线性
  for (int i = 0; i < 256; i++)
  {
    delay(20);
    pwmWrite(PB0, i * i); // pwmWrite可以认为 电压值，设置他的值
    pwmWrite(PA7, i * i);
    pwmWrite(PA6, i * i);
    pwmWrite(PA3, i * i);
    pwmWrite(PA2, i * i);
    pwmWrite(PA1, i * i);
    pwmWrite(PA0, i * i);
    pwmWrite(PB7, i * i);
    pwmWrite(PB6, i * i);
    pwmWrite(PA10, i * i);
    pwmWrite(PA9, i * i);
    pwmWrite(PA8, i * i);
  }
   for (int i = 256; i >0; i--)
  {
    delay(20);
    pwmWrite(PB0, i * i); // pwmWrite可以认为 电压值，设置他的值
    pwmWrite(PA7, i * i);
    pwmWrite(PA6, i * i);
    pwmWrite(PA3, i * i);
    pwmWrite(PA2, i * i);
    pwmWrite(PA1, i * i);
    pwmWrite(PA0, i * i);
    pwmWrite(PB7, i * i);
    pwmWrite(PB6, i * i);
    pwmWrite(PA10, i * i);
    pwmWrite(PA9, i * i);
    pwmWrite(PA8, i * i);
  }
  
}
